//
//  RJTableCell.m
//  Estate
//
//  Created by heyong on 16/6/2.
//  Copyright © 2016年 ttsx. All rights reserved.
//

#import "RJTableCell.h"

@implementation RJTableCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.title.font=[UIFont systemFontOfSize:18*BIZ];
    self.name.font=[UIFont systemFontOfSize:17*BIZ];
    self.state.font=[UIFont systemFontOfSize:16*BIZ];
    self.time.font=[UIFont systemFontOfSize:16*BIZ];
    
    self.selectionStyle=UITableViewCellSelectionStyleNone;
    self.title.textColor=[UIColor colorWithRed:0.36 green:0.36 blue:0.37 alpha:1.00];
    self.time.textColor=[UIColor colorWithRed:0.47 green:0.47 blue:0.47 alpha:1.00];
    self.name.textColor=[UIColor colorWithRed:0.06 green:0.60 blue:0.55 alpha:1.00];
    self.state.textColor=[UIColor colorWithRed:0.34 green:0.45 blue:0.65 alpha:1.00];
    
}
- (void)setType:(NSString *)type{
    

    /*
     *  旁站_通用/RECORD_02_01
     *  旁站_卷材防水/RECORD_02_02,
     *  旁站_回填土/RECORD_02_03,
     *  旁站_混凝土施工/RECORD_02_04,
     *  旁站_混凝土灌注桩/RECORD_02_05
     */
    _type=type;
    //旁站通用
//    if([_type isEqualToString:@"RECORD_02_01"]){
        self.line.backgroundColor=[UIColor colorWithRed:0.78 green:0.26 blue:0.09 alpha:1.00];
//
//    }else if([_type isEqualToString:@"RECORD_02_02"]){    //旁站防水
//
//        self.line.backgroundColor=[TTTheme defaultManger].selectColor;
//    }else if([_type isEqualToString:@"RECORD_02_03"]){    //旁站回填土
//
//        self.line.backgroundColor=[UIColor colorWithRed:0.11 green:0.69 blue:0.93 alpha:1.00];
//    }else if ([_type isEqualToString:@"RECORD_02_04"]){    //旁站混泥土
//
//        self.line.backgroundColor=[UIColor colorWithRed:0.75 green:0.35 blue:0.58 alpha:1.00];
//
//    }else if([_type isEqualToString:@"RECORD_02_05"]) {    //旁站混泥土灌注桩
//        self.line.backgroundColor=[UIColor colorWithRed:0.17 green:0.67 blue:0.25 alpha:1.00];
        
//    }else
     if([_type isEqualToString:@"0"]){ //日记待审阅
        
        self.line.backgroundColor=[UIColor colorWithRed:0.78 green:0.26 blue:0.09 alpha:1.00];
        self.state.text=@"未审阅";
        self.state.textColor=[UIColor colorWithRed:0.08 green:0.61 blue:0.56 alpha:1.00];
        
    }else if([_type isEqualToString:@"1"]){// 日记已审阅
        
        self.line.backgroundColor=[UIColor colorWithRed:0.11 green:0.69 blue:0.93 alpha:1.00];
        self.state.text=@"已审阅";

    }else if ([_type isEqualToString:@"待审阅"]){
        
        CGFloat h=self.contentView.frame.size.height;
        CGFloat w=5.*BIZ;
        
        UIImageView * imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 2, w, h)];
        
        imgView.image = [UIImage imageNamed:@"juchi"];
        self.state.text=@"待审阅•";
        self.state.textColor=[UIColor colorWithRed:0.78 green:0.25 blue:0.09 alpha:1.00];
        [self.line addSubview:imgView];
        self.line.backgroundColor=[UIColor whiteColor];
        
    }else if ([_type isEqualToString:@"已审阅"]){
        
        CGFloat h=self.contentView.frame.size.height;
        CGFloat w=5.*BIZ;
        
        UIImageView * imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 2, w, h)];
        imgView.image = [UIImage imageNamed:@"juchi2"];
        self.state.text=@"已审阅•";
        self.state.textColor=[UIColor colorWithRed:0.08 green:0.58 blue:0.53 alpha:1.00];
        [self.line addSubview:imgView];
        self.line.backgroundColor=[UIColor whiteColor];
        
    }
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
